package com.jumeng.resp;


import com.jumeng.entity.CourseEntity;
import com.jumeng.enums.CourseEnum;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class CoursesRes {

    private Integer id;

    private String code;

    private String name;

    /**
     * 描述
     */
    private String details;

    /**
     * 课程类别
     */
    private CourseEnum courseEnum;

    /**
     * 课程视频地址
     * @return
     */
    private String courseVideoUrl;

    /**
     * 课程封面图片地址
     * @return
     */
    private String courseImgUrl;

    /**
     * 当前登录人账户
     * @param courseEntity
     */
    private String accountStationNo;

    /**
     * 是否已经付费观看
     * @param courseEntity
     */
    private Boolean canShow = false;

    private BigDecimal price;


    public CoursesRes(CourseEntity courseEntity) {
        this.id = courseEntity.getId();
        this.name = courseEntity.getCourseName();
        this.code = courseEntity.getCode();
        this.details = courseEntity.getDetails();
        this.courseEnum = courseEntity.getCourseEnum();
        this.courseVideoUrl = courseEntity.getCourseVideoUrl();
        this.courseImgUrl = courseEntity.getCourseImgUrl();
        this.price = courseEntity.getPrice();
    }
}
